﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<IEnumerable<brjostagjof.Models.Question>>" %>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
	Spurningar
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">

    <a href="/Home/GetQuestionByCategoryID/<%: Model.FirstOrDefault().ArticleBase.articleCategoryID %>" class="linksWhite">Tímaröð</a>
    <a href="/Home/SogS/" class="linksWhite">Til baka í S.og.S</a>
    <h2>Spurningar raðaðar eftir stafrófsröð:</h2>

               <% foreach (var item in Model) { %>
        <div class="entry">
        <div class="entry-bgtop">
        <div class="entry-bgbtm">
                <h2 class="title"><%: item.ArticleBase.InformationBase.headline %></h2>
                <p class="meta">Höfundur: <a href="../../MySite/ViewUserByID/<%:item.ArticleBase.User.ID  %>"><%: item.ArticleBase.User.name%></a>, <%: item.ArticleBase.InformationBase.date %> &nbsp;&bull;&nbsp;
                <a href="/Home/GetQuestionByCategoryID/<%: item.ArticleBase.ArticleCategory.ID %>" class="permalink"> <%: item.ArticleBase.ArticleCategory.name %></a>
                &nbsp;&bull;&nbsp;
                <a href="<%: item.ArticleBase.link %><%: item.ArticleBase.informationBaseID %>" class="permalink">Öll spurning og svar</a></p>
            </div>
            </div>
            </div>
            <% if ( item.ArticleBase.User.userName == Page.User.Identity.Name)
               { %>
                <p><a href="/Home/EditQuestion/<%: item.articleBaseID %>">Breyta spurningu</a></p>
            <% } %>
            <% if (Page.User.IsInRole("Administrators") || Page.User.IsInRole("Specialists"))
               { %>
            <p><a href="/Home/EditQuestion/<%: item.articleBaseID %>">Breyta svari</a></p>
            <% }
                  } %>

</asp:Content>
